package com.oocl.service.impl;

import java.sql.SQLException;
import java.util.List;

import com.oocl.dao.AreasDao;
import com.oocl.dao.impl.AreasDaoImpl;
import com.oocl.exception.MyException;
import com.oocl.pojo.Area;
import com.oocl.service.AreasService;

public class AreasServiceImpl implements AreasService{
	private AreasDao aDao;
	
	public AreasServiceImpl(){
		aDao = new AreasDaoImpl();
	}

	public List<Area> searchByAreasByAreaName(String areaName)
			throws MyException {
		try {
			return aDao.searchByAreasByAreaName(areaName);
		} catch (SQLException e) {
			throw new MyException("查询出错");
		}
	}

	public List<String> serchAreasNamesByAreaName(String areaName)
			throws MyException {
		try {
			return aDao.serchAreasNamesByAreaName(areaName);
		} catch (SQLException e) {
			throw new MyException("查询出错");
		}
	}

}
